var/const
	LANG_LISTEN		= 1
	LANG_SPEAK		= 2
	LANG_READ		= 4
	LANG_WRITE		= 8
	LANG_LITERATE	= LANG_READ|LANG_WRITE
	LANG_NATIVE		= LANG_LISTEN|LANG_SPEAK|LANG_LITERATE


Living
	proc
		AddLanguage(txtLanguage as text)
			lstLanguages.Add("[txtLanguage]"=LANG_LISTEN|LANG_SPEAK)

		setCanListen(txtLanguage as text)
			if(lstLanguages.Find(txtLanguage))
				var/numFlag = lstLanguages[txtLanguage]
				numFlag |= LANG_LISTEN
				lstLanguages[txtLanguage] = numFlag
				return numFlag
			else
				return FALSE

		setCanSpeak(txtLanguage as text)
			if(lstLanguages.Find(txtLanguage))
				var/numFlag = lstLanguages[txtLanguage]
				numFlag |= LANG_SPEAK
				lstLanguages[txtLanguage] = numFlag
				return numFlag
			else
				return FALSE

		setCanRead(txtLanguage as text)
			if(lstLanguages.Find(txtLanguage))
				var/numFlag = lstLanguages[txtLanguage]
				numFlag |= LANG_READ
				lstLanguages[txtLanguage] = numFlag
				return numFlag
			else
				return FALSE

		setCanWrite(txtLanguage as text)
			if(lstLanguages.Find(txtLanguage))
				var/numFlag = lstLanguages[txtLanguage]
				numFlag |= LANG_WRITE
				lstLanguages[txtLanguage] = numFlag
				return numFlag
			else
				return FALSE